package com.smag.echarts.service.impl;

import java.util.List;
import com.smag.common.utils.DateUtils;
import com.smag.echarts.domain.EchartsConeType;
import com.smag.echarts.domain.vo.EchartsMapVo;
import com.smag.echarts.mapper.EchartsConeTypeMapper;
import com.smag.echarts.service.IEchartsConeTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 粮食种类Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-26
 */
@Service
public class EchartsConeTypeServiceImpl implements IEchartsConeTypeService
{
    @Autowired
    private EchartsConeTypeMapper echartsConeTypeMapper;

    /**
     * 查询粮食种类
     * 
     * @param id 粮食种类主键
     * @return 粮食种类
     */
    @Override
    public EchartsConeType selectEchartsConeTypeById(Long id)
    {
        return echartsConeTypeMapper.selectEchartsConeTypeById(id);
    }

    /**
     * 查询粮食种类列表
     * 
     * @param echartsConeType 粮食种类
     * @return 粮食种类
     */
    @Override
    public List<EchartsConeType> selectEchartsConeTypeList(EchartsConeType echartsConeType)
    {
        return echartsConeTypeMapper.selectEchartsConeTypeList(echartsConeType);
    }

    /**
     * 新增粮食种类
     * 
     * @param echartsConeType 粮食种类
     * @return 结果
     */
    @Override
    public int insertEchartsConeType(EchartsConeType echartsConeType)
    {
        echartsConeType.setCreateTime(DateUtils.getNowDate());
        return echartsConeTypeMapper.insertEchartsConeType(echartsConeType);
    }

    /**
     * 修改粮食种类
     * 
     * @param echartsConeType 粮食种类
     * @return 结果
     */
    @Override
    public int updateEchartsConeType(EchartsConeType echartsConeType)
    {
        echartsConeType.setUpdateTime(DateUtils.getNowDate());
        return echartsConeTypeMapper.updateEchartsConeType(echartsConeType);
    }

    /**
     * 批量删除粮食种类
     * 
     * @param ids 需要删除的粮食种类主键
     * @return 结果
     */
    @Override
    public int deleteEchartsConeTypeByIds(Long[] ids)
    {
        return echartsConeTypeMapper.deleteEchartsConeTypeByIds(ids);
    }

    /**
     * 删除粮食种类信息
     * 
     * @param id 粮食种类主键
     * @return 结果
     */
    @Override
    public int deleteEchartsConeTypeById(Long id)
    {
        return echartsConeTypeMapper.deleteEchartsConeTypeById(id);
    }

    @Override
    public List<EchartsMapVo> firstList() {
        return echartsConeTypeMapper.firstList();
    }
}
